package com.emperor.mapper;

import com.emperor.dto.ApplyPolicyRequestDto;
import com.emperor.dto.UpdateChannelRequestDto;
import com.emperor.dto.VmTypeDto;
import com.emperor.entity.ChannelList;
import com.emperor.entity.VendingMachine;
import com.emperor.entity.VmType;
import com.emperor.vo.BusinessTop10Vo;
import com.emperor.vo.ChannelListVo;
import com.emperor.vo.VmTypeVo;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface VmMapper {

    VmType findVmType(VmTypeDto vmTypeDto);


    List<ChannelListVo> findChannelList(String innerCode);

    void addVm(VmTypeVo build);

    @Insert("insert into vm_type (vm_type,node_id,create_userId,update_time values (#{vmType},#{nodeId},#{createUserId},#{updateTime})")
    void addVmMachine(VendingMachine vm);

    @Update("update  tb_vending_machine set node_id=#{nodeId} where identity ")
    void updateVm(Integer id, Integer nodeId);

    @Select("select sku_id,sku_name,sku_image as image from tb_sku where class_id = #{businessId}  ")
    List<BusinessTop10Vo> businessTop10(Integer businessId);

    void channelConfig(UpdateChannelRequestDto dto);

    void applyPolicy(ApplyPolicyRequestDto dto);
}
